<!DOCTYPE html>
<html lang="en">
<head>
	<meta charset="UTF-8">
    <!-- 微软的老式浏览器 -->
    <meta name="viewport" content="width=device-width,initial-scale=1.0, minimum-scale=1.0, maximum-scale=1.0, user-scalable=no"/>
    <!-- 显示窗口 宽度 是 客户端的 屏幕 宽度 （就是 满屏 ！），显示的文字和图形的初始比例 是 1.0 -->
    <link rel="stylesheet" href="css/layui.mobile.css">
    <link rel="stylesheet" type="text/css" href="css/bj.css">
    <link rel="stylesheet" type="text/css" href="css/weui.min.css">
    <link rel="stylesheet" href="css/jq-weui.min.css">
    <script src="js/jquery/rem.min.js"></script>
    <script src="js/common.js"></script>
	<title>我的信息</title>
  <style type="text/css">
      .formbd tr td span{
          color: #f3706c;
      }
  </style>
</head>
<body style="padding-bottom: 60px;">
<div class="pptv">
    <div class="popo">
        <div class="img-list">
            <div id="imglist">
                <!--<div class="img pr" style="background-image: url(http://cpfile.oss-cn-beijing.aliyuncs.com/portrait_pic/liuyifei1.jpg)">-->
                <!--<a href="javascript:;" class="pa" onclick="del(this)"></a>-->
                <!--</div>-->
            </div>
            <div class="addhao" id="upload-btn">
            </div>
        </div>

        <input style="display: none" type="file" id="file" accept="image/png,image/gif,image/jpeg,image/jpg">
    </div>
</div>
     <div class="bjxx">请填写基本信息(<span>必填</span>)</div>
     <form class="formbd">
     	  <table width="100%" border="0" >
              <tr>
                <td  align="left"><span>*</span>昵称</td>
                <td><input type="text"  class="text2" id = "name" placeholder="昵称"></td>
              </tr>

              <tr>
                <td  align="left"><span>*</span>性别</td>
                  <td><input value=""  class="text2" id = "sex" readonly  unselectable="on" onfocus="this.blur()"></td>
              </tr>

              <tr>
                <td  align="left"><span>*</span>生日</td>
                <td><input value="请选择"  class="text2" id = "showDatePicker" readonly  unselectable="on" onfocus="this.blur()"></td>
              </tr>
              <tr>
                  <td  align="left"><span>*</span>星座</td>
                  <td><input type="text"  class="text2" id = "xz" placeholder="请选择" readonly  unselectable="on" onfocus="this.blur()"></td>
              </tr>

              <tr>
                <td  align="left"><span>*</span>身高</td>
                <td><input type="text" placeholder="单位cm" class="text2" id = "sg"></td>
              </tr>
              <tr>
                  <td  align="left"><span>*</span>年收入</td>
                  <td><input type="text" value="请选择" class="text2" id = "nsr" readonly  unselectable="on" onfocus="this.blur()">
                  </td>
              </tr>
              <tr>
                  <td  align="left"><span>*</span>婚姻状态</td>
                  <td><input type="text" value="请选择" class="text2" id = "hyzt" readonly  unselectable="on" onfocus="this.blur()">
                  </td>
              </tr>
              <tr>
                  <td  align="left"><span>*</span>最高学历</td>
                  <td><input type="text" value="请选择" class="text2" id = "zgxl" readonly  unselectable="on" onfocus="this.blur()">
                  </td>
              </tr>
              <tr>
                  <td  align="left"><span>*</span>个人简介</td>
                  <td><input type="text"  class="text2"  id = "grjj" placeholder="个人简介"></td>
              </tr>
              <tr>
                <td  align="left"><span>*</span>行业/方向</td>
                <td><input type="text"  class="text2"  id = "hy" placeholder="输入行业"></td>
              </tr>

              <tr>
                <td  align="left"><span>*</span>公司名</td>
                <td><input type="text"  class="text2"  id = "gsname" placeholder="公司名称"></td>
              </tr>

              <tr>
                <td  align="left"><span>*</span>职位</td>
                <td><input type="text"  class="text2"  id = "zhiwei" placeholder="职位"></td>
              </tr>

              <tr>
                <td align="left"><span>*</span>微信号</td>
                <td><input type="text"  class="text2"  id = "weixin" placeholder="微信号"></td>
              </tr>

              <tr>
                <td  align="left"><span>*</span>工作地</td>
                <td style="width:75%">
                        <input type="text"  class="texts"  id = "gzaddress"  placeholder="请选择省市区">
                </td>
              </tr>

              <tr>
                <td  align="left"><span>*</span>家乡</td>
                <td><input type="text"  class="text2" id = "jxaddress" placeholder="请选择省市区"></td>
              </tr>
              </table>
     </form>
    <div class="bjxx" id="xtbtn">点击展开信息为(<span>选填</span>) <i></i></div>
    <form class="formbd dn" id="xtxx">
        <table width="100%" border="0" >

            <tr>
                <td  align="left">国籍</td>
                <td><input type="text"  class="text2" id = "gj" placeholder="输入国籍"></td>
            </tr>

            <tr>
                <td  align="left">民族</td>
                <td><input value="请选择"  class="text2" id = "mz"  readonly  unselectable="on" onfocus="this.blur()"></td>
            </tr>

            <tr>
                <td  align="left">信仰</td>
                <td><input type="text"  class="text2" id = "xy" readonly  unselectable="on" onfocus="this.blur()" value="请选择"></td>
            </tr>
            <tr>
                <td  align="left">饮酒情况</td>
                <td><input type="text" value="请选择" class="text2" id = "yjqk" readonly  unselectable="on" onfocus="this.blur()">
                </td>
            </tr>
            <tr>
                <td  align="left">吸烟情况</td>
                <td><input type="text" value="请选择" class="text2" id = "xyqk" readonly  unselectable="on" onfocus="this.blur()">
                </td>
            </tr>
            <tr>
                <td  align="left">兄弟姐妹数</td>
                <td><input type="tel" placeholder="输入数字" class="text2" id = "xdjms">
                </td>
            </tr>
            <tr>
                <td  align="left">兄弟姐妹中排行</td>
                <td><input type="text"  class="text2" value="请选择" id = "xdph"  readonly  unselectable="on" onfocus="this.blur()"></td>
            </tr>
            <tr>
                <td  align="left">子女数量</td>
                <td><input type="tel"  class="text2"  id = "znsl" placeholder="输入数字"></td>
            </tr>

            <tr>
                <td  align="left">子女情况</td>
                <td><input type="text"  class="text2"  id = "znqk" readonly  unselectable="on" onfocus="this.blur()" value="请选择"></td>
            </tr>

            <tr>
                <td  align="left">体重</td>
                <td><input type="tel"  class="text2"  id = "tz" placeholder="单位:Kg"></td>
            </tr>

            <tr>
                <td align="left">血型</td>
                <td><input value="请选择"  class="text2"  id = "xuexin" readonly  unselectable="on" onfocus="this.blur()"></td>
            </tr>

            <tr>
                <td  align="left">名下房子数量</td>
                <td style="width:75%">
                    <input type="text"  class="texts"  id = "fzsl"  placeholder="输入数字 如:1">
                </td>
            </tr>

            <tr>
                <td  align="left">是否购房</td>
                <td><input type="text"  class="text2" id = "sfgf" readonly  unselectable="on" onfocus="this.blur()" value="请选择"></td>
            </tr>
            <tr>
                <td  align="left">名下车子数量</td>
                <td style="width:75%">
                    <input type="text"  class="texts"  id = "czsl"  placeholder="输入数字 如:1">
                </td>
            </tr>
            <tr>
                <td  align="left">是否购车</td>
                <td><input type="text"  class="text2" id = "sfgc" readonly  unselectable="on" onfocus="this.blur()" value="请选择"></td>
            </tr>
            <tr>
                <td  align="left">希望中的他/她</td>
                <td style="width:75%">
                    <input type="text"  class="texts"  id = "xwt"  placeholder="希望中的Ta~~">
                </td>
            </tr>
            <!--<tr>-->
                <!--<td  align="left">身份证号</td>-->
                <!--<td style="width:75%">-->
                    <!--<input type="text"  class="texts"  id = "sfz"  placeholder="身份证号">-->
                <!--</td>-->
            <!--</tr>-->
            <tr>
                <td  align="left">专科学校名称</td>
                <td style="width:75%">
                    <input type="text"  class="texts"  id = "zkxx"  placeholder="学校名称">
                </td>
            </tr>
            <tr>
                <td  align="left">本科学校名称</td>
                <td style="width:75%">
                    <input type="text"  class="texts"  id = "bkxx"  placeholder="学校名称">
                </td>
            </tr>
            <tr>
                <td  align="left">硕士学校名称</td>
                <td style="width:75%">
                    <input type="text"  class="texts"  id = "ssxx"  placeholder="学校名称">
                </td>
            </tr>
            <tr>
                <td  align="left">博士学校名称</td>
                <td style="width:75%">
                    <input type="text"  class="texts"  id = "bsxx"  placeholder="学校名称">
                </td>
            </tr>
        </table>
    </form>


    <input value="下一步" class="anniu" type="submit" onclick="submit()">
    <script src="js/jquery/jquery-2.2.4.min.js"></script>
    <script src="js/utils.js"></script>
    <script src="js/bjinfo.js"></script>
    <script type="text/javascript" src="js/jquery/weui.min.js"></script>
    <script type="text/javascript" src="js/jquery/jquery-weui.min.js"></script>
    <script src="js/jquery/city-picker.min.js"></script>
    <script src="js/jquery/upload.js"></script>
    <script src="js/jquery/layer.js"></script>
 <script>
     //user/get_show_pic
     var isFirst=1;
     $("input").attr("data-id","-1");
     var imgarr=[];
     var imgurl="";
     getimg();
     function getimg() {
         $.ajax({
             type : "POST",
             url : getRequestUrl("/user/get_show_pic"),
             //data:parms,
             success : function(datas) {
                 console.log(datas.response_params.result);
                 var arr=datas.response_params.result;
                 var strs="";
                 $.each(arr,function (i,el) {
                     strs+=`<div class="img pr" style="background-image: url(`+el.origin_pic+`)">
						 <a href="javascript:;" class="pa" data-id=`+i+` onclick="del(this)" data-picid=`+el.id+`></a>
					 </div>`;
                     var imgurl=el.origin_pic;
                     imgarr.push(imgurl)
                 });
                 if(arr.length=="6"){
                     $("#upload-btn").hide();
                 }
                 $(strs).appendTo("#imglist")
             },
             error : function(err) {
            	 dealCPErrorResponse(err);
             }
         });
     }

     $('#showDatePicker').on('click', function () {
         weui.datePicker({
             start: 1970,
             end: new Date().getFullYear(),
             onChange: function (result) {
                 console.log(result);
             },
             onConfirm: function (result) {
                 console.log(result);
                 var arr=[];
                 $.each(result,function (i,el) {if(el<10){el="0"+el;arr.push(el);}else {arr.push(el)}});
                 $('#showDatePicker').val(arr.join("-"))
             }
         });
     });
     $('#sex').on('click', function () {
         weui.picker([{
             label: '男',
             value: 1
         }, {
             label: '女',
             value: 2
         }], {
             onConfirm: function (result) {
                 console.log(result);
                 var str="女";
                 if(result==1){
                    str="男"
                 }
                 $("#sex").val(str).attr("data-id",result)

             }
         });
     });
     $('#nsr').on('click', function () {
         weui.picker([{
             label: '5-10W',
             value: 1
         }, {
             label: '10-20W',
             value: 2
         }, {
             label: '20-30W',
             value: 3
         }, {
             label: '30-40W',
             value: 4
         }, {
             label: '40-50W',
             value: 5
         }, {
             label: '50-60W',
             value: 6
         }, {
             label: '60W以上',
             value: 7
         }], {
             onConfirm: function (result) {
                 console.log(result);
                 var str="";
                 if(result==1){
                     str="5-10W"
                 }else if(result==2){
                     str="10-20W"
                 }else if(result==3){
                     str="20-30W"
                 }else if(result==4){
                     str="30-40W"
                 }else if(result==5){
                     str="40-50W"
                 }else if(result==6){
                     str="50-60W"
                 }else if(result==7){
                     str="60W以上"
                 }
                 $("#nsr").val(str).attr("data-id",result)

             }
         });
     });
     $('#hyzt').on('click', function () {
         weui.picker([{
             label: '未婚',
             value: 1
         }, {
             label: '离异',
             value: 2
         }, {
             label: '丧偶',
             value: 3
         }], {
             onConfirm: function (result) {
                 console.log(result);
                 var str="";
                 if(result==1){
                     str="未婚"
                 }else if(result==2){
                     str="离异"
                 }else if(result==3){
                     str="丧偶"
                 }
                 $("#hyzt").val(str).attr("data-id",result)

             }
         });
     });
     $('#zgxl').on('click', function () {
         weui.picker([{
             label: '中专以下',
             value: 1
         }, {
             label: '专科',
             value: 2
         }, {
             label: '本科',
             value: 3
         }, {
             label: '硕士',
             value: 4
         }, {
             label: '博士',
             value: 5
         }], {
             onConfirm: function (result) {
                 console.log(result[0]);
                 var str="";
                 if(result==1){
                     str="中专以下"
                 }else if(result==2){
                     str="专科"
                 }else if(result==3){
                     str="本科"
                 }else if(result==4){
                     str="硕士"
                 }else if(result==5){
                     str="博士"
                 }
                 $("#zgxl").val(str).attr("data-id",result)

             }
         });
     });
     var gsarr=[];
     var jxarr=[];
        $("#gzaddress").cityPicker({
            title: "选择地址",
            onChange: function (picker, values, displayValues) {
                //console.log(values, displayValues);
                gsarr=values;
                console.log(gsarr)
            }
        });
     $("#jxaddress").cityPicker({
         title: "选择地址",
         onChange: function (picker, values, displayValues) {
             console.log(values, displayValues);
             jxarr=values
             console.log(jxarr)
         }
     });
     $('#xz').on('click', function () {
         weui.picker([{
             label: '白羊座',
             value: 1
         }, {
             label: '金牛座',
             value: 2
         }, {
             label: '双子座',
             value: 3
         }, {
             label: '巨蟹座',
             value: 4
         }, {
             label: '狮子座',
             value: 5
         }, {
             label: '处女座',
             value: 6
         }, {
             label: '天秤座',
             value: 7
         }, {
             label: '天蝎座',
             value: 8
         }, {
             label: '射手座',
             value: 9
         }, {
             label: '摩羯座',
             value: 10
         }, {
             label: '水瓶座',
             value: 11
         }, {
             label: '双鱼座',
             value: 12
         }], {
             onConfirm: function (result) {
                 console.log(result[0]);
                 var str="";
                 if(result==1){
                     str="白羊座"
                 }else if(result==2){
                     str="金牛座"
                 }else if(result==3){
                     str="双子座"
                 }else if(result==4){
                     str="巨蟹座"
                 }else if(result==5){
                     str="狮子座"
                 }else if(result==6){
                     str="处女座"
                 }else if(result==7){
                     str="天秤座"
                 }else if(result==8){
                     str="天蝎座"
                 }else if(result==9){
                     str="射手座"
                 }else if(result==10){
                     str="摩羯座"
                 }else if(result==11){
                     str="水瓶座"
                 }else if(result==12){
                     str="双鱼座"
                 }
                 $("#xz").val(str).attr("data-id",result)

             }
         });
     });

     var datas=["阿昌族","鄂温克族", "傈僳族", "水族", "白族", "高山族	", "珞巴族", "塔吉克族", "保安族	", "仡佬族", "满族", "塔塔尔族",
         "布朗族", "哈尼族", "毛南族	", "土家族	","布依族", "哈萨克族", "门巴族", "土族", "朝鲜族	", "汉族", "蒙古族	", "佤族", "达斡尔族",
         "赫哲族", "苗族", "维吾尔族", "傣族", "回族", "仫佬族", "乌孜别克族	", "德昂族	", "基诺族	", "纳西族", "锡伯族", "东乡族	", "京族","怒族",
         "瑶族", "侗族", "景颇族", "普米族", "彝族", "独龙族", "柯尔克孜族	", "羌族", "裕固族	", "俄罗斯族", "拉祜族	", "撒拉族	", "藏族", "鄂伦春族",
         "黎族", "畲族", "壮族"];
     var arr=[];
     $.each(datas,function (i,el) {
         var obj={};
         obj.label=el;
         obj.value=i+1;
         arr.push(obj)
     });
    // console.log(arr)
     $('#mz').on('click', function () {
         weui.picker(arr, {
             onConfirm: function (result) {
                 console.log(result);
                 var str=datas[result-1];
                 console.log(str);
                 $("#mz").val(str).attr("data-id",result)
             }
         });
     });
     $('#xy').on('click', function () {
         weui.picker([{
             label: '无信仰',
             value: 1
         }, {
             label: '马列主义',
             value: 2
         }, {
             label: '基督教',
             value: 3
         }, {
             label: '佛教徒',
             value: 4
         }, {
             label: '道教',
             value: 5
         }, {
             label: '伊斯兰教',
             value: 6
         }, {
             label: '其他',
             value: 7
         }], {
             onConfirm: function (result) {
                 console.log(result);
                 var str="";
                 if(result==1){
                     str="无信仰"
                 }else if(result==2){
                     str="马列主义"
                 }else if(result==3){
                     str="基督教"
                 }else if(result==4){
                     str="佛教徒"
                 }else if(result==5){
                     str="道教"
                 }else if(result==6){
                     str="伊斯兰教"
                 }else if(result==7){
                     str="其他"
                 }
                 $("#xy").val(str).attr("data-id",result)

             }
         });
     });
     $('#yjqk').on('click', function () {
         weui.picker([{
             label: '从不',
             value: 1
         }, {
             label: '偶尔',
             value: 2
         }, {
             label: '看情况',
             value: 3
         }, {
             label: '经常',
             value: 4
         }], {
             onConfirm: function (result) {
                 console.log(result);
                 var str="";
                 if(result==1){
                     str="从不"
                 }else if(result==2){
                     str="偶尔"
                 }else if(result==3){
                     str="看情况"
                 }else if(result==4){
                     str="经常"
                 }
                 $("#yjqk").val(str).attr("data-id",result)

             }
         });
     });

     $('#xyqk').on('click', function () {
         weui.picker([{
             label: '从不',
             value: 1
         }, {
             label: '偶尔',
             value: 2
         }, {
             label: '看情况',
             value: 3
         }, {
             label: '经常',
             value: 4
         }], {
             onConfirm: function (result) {
                 console.log(result);
                 var str="";
                 if(result==1){
                     str="从不"
                 }else if(result==2){
                     str="偶尔"
                 }else if(result==3){
                     str="看情况"
                 }else if(result==4){
                     str="经常"
                 }
                 $("#xyqk").val(str).attr("data-id",result)

             }
         });
     });
     $('#xdph').on('click', function () {
         weui.picker([{
             label: '老大',
             value: 1
         }, {
             label: '老二',
             value: 2
         }, {
             label: '老三',
             value: 3
         }, {
             label: '老四',
             value: 4
         }, {
             label: '老幺',
             value: 5
         },{
                 label: '独生子女',
                 value: 6
             }], {
             onConfirm: function (result) {
                 console.log(result);
                 var str="";
                 if(result==1){
                     str="老大"
                 }else if(result==2){
                     str="老二"
                 }else if(result==3){
                     str="老三"
                 }else if(result==4){
                     str="老四"
                 }else if(result==5){
                     str="老幺"
                 }else if(result==6){
                     str="独生子女"
                 }
                 $("#xdph").val(str).attr("data-id",result)

             }
         });
     });
     $('#znqk').on('click', function () {
         weui.picker([{
             label: '无小孩',
             value: 1
         }, {
             label: '有小孩归自己',
             value: 2
         }, {
             label: '有小孩归对方',
             value: 3
         }], {
             onConfirm: function (result) {
                 console.log(result);
                 var str="";
                 if(result==1){
                     str="无小孩"
                 }else if(result==2){
                     str="有小孩归自己"
                 }else if(result==3){
                     str="有小孩归对方"
                 }
                 $("#znqk").val(str).attr("data-id",result)

             }
         });
     });
     $('#xuexin').on('click', function () {
         weui.picker([{
             label: 'A型',
             value: 1
         }, {
             label: 'B型',
             value: 2
         }, {
             label: 'AB型',
             value: 3
         }, {
             label: 'O型',
             value: 4
         }, {
             label: '其他',
             value: 5
         }], {
             onConfirm: function (result) {
                 console.log(result);
                 var str="";
                 if(result==1){
                     str="A型"
                 }else if(result==2){
                     str="B型"
                 }else if(result==3){
                     str="AB型"
                 }else if(result==4){
                     str="O型"
                 }else if(result==5){
                     str="其他"
                 }
                 $("#xuexin").val(str).attr("data-id",result)

             }
         });
     });
     $('#sfgf').on('click', function () {
         weui.picker([{
             label: '已购',
             value: 1
         }, {
             label: '未购',
             value: 2
         }, {
             label: '准备购入',
             value: 3
         }], {
             onConfirm: function (result) {
                 console.log(result);
                 var str="";
                 if(result==1){
                     str="已购"
                 }else if(result==2){
                     str="未购"
                 }else if(result==3){
                     str="准备购入"
                 }
                 $("#sfgf").val(str).attr("data-id",result)

             }
         });
     });
     $('#sfgc').on('click', function () {
         weui.picker([{
             label: '已购',
             value: 1
         }, {
             label: '未购',
             value: 2
         }, {
             label: '准备购入',
             value: 3
         }], {
             onConfirm: function (result) {
                 console.log(result);
                 var str="";
                 if(result==1){
                     str="已购"
                 }else if(result==2){
                     str="未购"
                 }else if(result==3){
                     str="准备购入"
                 }
                 $("#sfgc").val(str).attr("data-id",result)

             }
         });
     });

     function submit() {
         if(imgarr.length=="0"){
             layer.open({
                 content:"至少上传一张照片",time:1,skin:"msg"
             });return false;
         } else if($("#name").val()==""){
            layer.open({
                content:"昵称不能为空",time:1,skin:"msg"
            });return false;
        }else if($("#sex").val()=="请选择"){
             layer.open({
                 content:"请选择性别",time:1,skin:"msg"
             });return false;
         }else if($("#showDatePicker").val()=="请选择"){
             layer.open({
                 content:"请选择生日",time:1,skin:"msg"
             });return false;
         } else if($("#xz").val()=="请选择"){
             layer.open({
                 content:"请选择星座",time:1,skin:"msg"
             });return false;
         }else if($("#sg").val()==""){
             layer.open({
                 content:"请填写身高",time:1,skin:"msg"
             });return false;
         }else if($("#nsr").val()=="请选择"){
             layer.open({
                 content:"请选择年收入",time:1,skin:"msg"
             });return false;
         }else if($("#hyzt").val()=="请选择"){
             layer.open({
                 content:"请选择婚姻状态",time:1,skin:"msg"
             });return false;
         }else if($("#zgxl").val()=="请选择"){
             layer.open({
                 content:"请选择最高学历",time:1,skin:"msg"
             });return false;
         }if($("#grjj").val()==""){
             layer.open({
                 content:"请填写个人简介",time:1,skin:"msg"
             });return false;
         }else if($("#hy").val()==""){
             layer.open({
                 content:"请填写行业信息",time:1,skin:"msg"
             });return false;
         }else if($("#gsname").val()==""){
             layer.open({
                 content:"请填写公司名称",time:1,skin:"msg"
             });return false;
         }else if($("#zhiwei").val()==""){
             layer.open({
                 content:"请填写职位",time:1,skin:"msg"
             });return false;
         }else if($("#weixin").val()==""){
             layer.open({
                 content:"请填写微信号",time:1,skin:"msg"
             });return false;
         }else if($("#gzaddress").val()=="请选择省市区"){
             layer.open({
                 content:"请选择工作地址",time:1,skin:"msg"
             });return false;
         }else if($("#jxaddress").val()=="请选择省市区"){
             layer.open({
                 content:"请选择家乡地址",time:1,skin:"msg"
             });return false;
         }
         var parms={
             nick_name:$("#name").val(),
             zodiac_sign:$("#xz").attr("data-id"),
             wx_account:$("#weixin").val(),
             industry:$("#hy").val(),
             position:$("#zhiwei").val(),
             birth_date:$("#showDatePicker").val(),
             gender:$("#sex").attr("data-id"),
             height:$("#sg").val(),
             income:$("#nsr").attr("data-id"),
             marital_status:$("#hyzt").attr("data-id"),
             company:$("#gsname").val(),
             citizenship:$("#gj").val(),
             profile:$("#grjj").val(),
             education:$("#zgxl").attr("data-id"),
             live_province_code:gsarr[0],
             live_city_code:gsarr[1],
             live_county_code:gsarr[2],
             native_province_code:jxarr[0],
             native_city_code:jxarr[1],
             native_county_code:jxarr[2],
             nation_code:$("#mz").attr("data-id"),
             faith_status:$("#xy").attr("data-id"),
             drink_status:$("#yjqk").attr("data-id"),
             smoke_status:$("#xyqk").attr("data-id"),
             sibling_cnt:$("#xdjms").val(),
             family_rank:$("#xdph").attr("data-id"),
             children_cnt:$("#znsl").val(),
             children_status:$("#znqk").attr("data-id"),
             weight:$("#tz").val(),
             blood_type:$("#xuexin").attr("data-id"),
             house_cnt:$("#fzsl").val(),
             house_status:$("#sfgf").attr("data-id"),
             car_cnt:$("#czsl").val(),
             car_status:$("#sfgc").attr("data-id"),
             wish_desc:$("#xwt").val(),
             id_card:$("#sfz").val(),
             junior_college_name:$("#zkxx").val(),
             college_name:$("#bkxx").val(),
             postgraduate_college_name:$("#ssxx").val(),
             doctor_college_name:$("#bsxx").val()
         };
         console.log(parms);
         //addimg();
         $.ajax({
             type : "POST",
             url : getRequestUrl("/user/update"),
             data:parms,
             success : function(datas) {
                 console.log(datas.response_params.result);
                 layer.open({
                     content:"基本信息提交成功",time:1,skin:"msg"
                 });
                 setTimeout(function () {
                     if(isFirst==1){
                         window.location.href="Id-card2-certification.html"
                     }else {
                        history.go(-1)
                     }

                 },2000)

             },
             error : function(err) {
            	 dealCPErrorResponse(err);
             }
         });
     }
     $(function () {
         $("#xtbtn").on('click',function () {
             $("#xtxx").slideToggle(500)
         });
         new Upload({
             button :"#upload-btn",
             file : '#file',
             module : 'album',
             success : function (url) {
                 $("#imglist").html("");

                 console.log(url);
//
                 imgurl=url;
                    addimg();

//                 console.log(imgarr);
//                 var strs="";
//                 $.each(imgarr,function (i,el) {
//                     strs+=`<div class="img pr" style="background-image: url(`+el+`)">
//						 <a href="javascript:;" class="pa" data-id=`+i+` onclick="del(this)"></a>
//					 </div>`
//                 });
//                 $(strs).appendTo("#imglist");
//                 if(imgarr.length==7){
//                     $("#upload-btn").hide();
//                 }
             },
             error : function (data) {
                 alert('error');
             }
         });
     });
     function del(obj) {
         var $this=$(obj);
         var index=$this.attr("data-id");
         var id=$this.attr("data-picid");
         $.ajax({
             type : "POST",
             url : getRequestUrl("/user/del_show_pic"),
             data:{
                 show_pic_id:id
             },
             success : function(datas) {
                 console.log(datas);
                 getimg();
             },
             error : function(err) {
            	 dealCPErrorResponse(err);
             }
         });
         imgarr.splice(index,1);
         $this.parent().remove();
         $("#imglist").html("");
//         var strs="";
//         $.each(imgarr,function (i,el) {
//             strs+=`<div class="img pr" style="background-image: url(`+el+`)">
//						 <a href="javascript:;" class="pa" data-id=`+i+` onclick="del(this)"></a>
//					 </div>`
//         });
//         $(strs).appendTo("#imglist");
         $("#upload-btn").show();
         console.log(imgarr)
     }
     function addimg() {
         $.ajax({
             type : "POST",
             url : getRequestUrl("/user/add_show_pic"),
             data:{
                 shelter_pic:imgurl,
                 origin_pic:imgurl
             },
             success : function(datas) {
                 console.log(datas);
                 getimg();
             },
             error : function(err) {
            	 dealCPErrorResponse(err);
             }
         });
     }
 </script>
</body>
</html>